package cn.wygandwdn.common.config;

/**
 * @description:
 * @author: WYG
 * @time: 2021/10/29 21:35
 */

public class RpcServiceConfig {
    /**
     * 服务版本号
     */
    private String version;
    /**
     * 服务分组
     */
    private String group;
    /**
     * 服务实体类
     */
    private Object service;

    public RpcServiceConfig(Builder builder) {
        this.version = builder.version;
        this.group = builder.group;
        this.service = builder.service;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getGroup() {
        return group;
    }

    public void setGroup(String group) {
        this.group = group;
    }

    public Object getService() {
        return service;
    }

    public void setService(Object service) {
        this.service = service;
    }

    @Override
    public String toString() {
        return "RpcServiceConfig{" +
                "version='" + version + '\'' +
                ", group='" + group + '\'' +
                ", service=" + service +
                '}';
    }

    public static class Builder {
        private String version;
        private String group;
        private Object service;

        public Builder version(String version) {
            this.version = version;
            return this;
        }

        public Builder group(String group) {
            this.group = group;
            return this;
        }

        public Builder service(Object service) {
            this.service = service;
            return this;
        }

        public RpcServiceConfig build() {
            return new RpcServiceConfig(this);
        }

    }

}
